﻿Public Class Util
    Public Shared Function getRandomHexCodeString(ByVal length As Integer) As String
        Dim i As Integer
        Dim strRnd As String
        Dim strResult As String

        strResult = ""

        For i = 0 To length - 1
            Randomize()
            strRnd = Conversion.Hex(CInt(Int((16) * Rnd())))
            strResult = strResult & strRnd
        Next

        Return strResult

    End Function
    Public Shared Function Base64Encode(ByVal src As String, ByVal enc As System.Text.Encoding) As String

        Dim arr As Byte() = enc.GetBytes(src)

        Return Convert.ToBase64String(arr)

    End Function
End Class
